import request from '@/utils/request';

// 我的薪资-薪资基础信息
export async function queryMySalaryBaseInfo() {
    return request('/api/finance/salary/v1/salaryBase/currentEmployee');
}
// 我的薪资-薪资记录
export async function querySalaryHistory(year) {
    return request(`/api/finance/salary/v1/salaryBase/currentEmployee/salary/history/${year}`);
}
// 我的薪资-绩效记录
export async function queryKpiHistory(year) {
    return request(`/api/finance/salary/v1/salaryBase/currentEmployee/kpi/history/${year}`);
}
// 我的薪资-获取最新薪资年月
export async function querySalaryBaseYearMonth() {
    return request('/api/finance/salary/v1/salaryBase/yearMonth');
}
// 我的薪资-考勤记录
export async function queryAttendHistory(year, month) {
    return request(`/api/finance/salary/v1/salaryBase/currentEmployee/attend/history/${year}/${month}`);
}
// 我的薪资-专项扣款扣除
export async function queryTaxHistory(year) {
    return request(`/api/finance/salary/v1/salaryBase/currentEmployee/social/history/${year}`);
}

/** 我的薪资-数据详情-查询图表类型集合 */
export async function querySalaryRecheckDataChartType(postData) {
    return request('/api/finance/salary/v1/salaryBase/chart/type', {
        method: 'POST',
        data: postData
    });
}

/** 我的薪资-数据详情-通过图表类型查询数据详情 */
export async function querySalaryRecheckDataChartTypeList(postData) {
    return request('/api/finance/salary/v1/salaryBase/chart/detail', {
        method: 'POST',
        data: postData
    });
}
/** 我的薪资-导出薪资单 */
export async function salaryPayrollPrint(postData) {
    return request(
        `/api/finance/salary/v1/salaryPayroll/data/print/${postData.organizationCode}/${postData.payrollId}`,
        {
            method: 'GET',
            getResponse: true,
            encryption: false,
            isFile: true,
            responseType: 'blob',
            headers: { 'Content-Type': 'application/pdf' }
        }
    );
}
